import { Injectable } from '@angular/core';
import { AdminModel, AdminService } from './admin.service';
import { Resolve, ActivatedRouteSnapshot } from '@angular/router';

@Injectable({
	providedIn: 'root',
})
export class ListService implements Resolve<AdminModel[]> {
	constructor(private adminService: AdminService) {}

	resolve(route: ActivatedRouteSnapshot) {
		return this.adminService.tree();
	}
}
